/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package fri.daolayer;

import fri.businessLayer.CurrencyBeanRemote;
import fri.businessLayer.HistoryBeanRemote;
import fri.entiry.FrCurrency;
import java.util.List;
import javax.naming.Context;
import javax.naming.InitialContext;

/**
 *
 * @author NguyenDongUIT
 */
public class CurrencyDAO {
    public static String getNameCurrency(int idCurrency) {
        try {

            Context ic = new InitialContext();
            CurrencyBeanRemote rm = (CurrencyBeanRemote) ic.lookup("fri.businessLayer.CurrencyBeanRemote");
            return rm.getNameCurrency(idCurrency);

        } catch (Exception e) {

            e.printStackTrace();
            System.out.println("Error: " + e.getMessage());
        }
        return null;
        
        
    }
    public static List<FrCurrency> getAllCurrency() {
        try {

            Context ic = new InitialContext();
            CurrencyBeanRemote rm = (CurrencyBeanRemote) ic.lookup("fri.businessLayer.CurrencyBeanRemote");
            return rm.getAllCurrency();

        } catch (Exception e) {

            e.printStackTrace();
            System.out.println("Error: " + e.getMessage());
        }
        return null;
        
    }
    
}
